package com.sromku.simple.fb.example.views;

import java.util.ArrayList;
import java.util.List;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.hal.model.Departement;
import com.example.hal.model.Offre;
import com.sromku.simple.fb.example.R;

public class ListOffreAdapter extends ArrayAdapter<Offre> {
 
 
    @SuppressLint("ViewHolder")
	@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater)
          getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
        View rowView = inflater.inflate(R.layout.listview_offre, parent, false);

        TextView titreView = (TextView) rowView.findViewById(R.id.titreOffreListView);
        TextView textView = (TextView) rowView.findViewById(R.id.textOffreListView);
        titreView.setText(getItem(position).getTitre());
        textView.setText(getItem(position).getTexte());
        Log.e("ListOffreAdapter", textView.getText().toString());
        return rowView;
    }
 
    public ListOffreAdapter(Context context, Offre[] values) {
        super(context, R.layout.listview_offre, values);
    }

	public ListOffreAdapter(FragmentActivity activity, List<Offre> listsOffre) {
        super(activity, R.layout.listview_offre, listsOffre);
	}



}